
$(function(){
        var top = window.screen.height / 2 - 250;
        var left = window.screen.width / 2 - 300;
        
        // 上传数据到九章
        function pushDataToJZ(obj){
        	var proId = obj.parents(".comWarea").attr("proid");
        	window._JX_INFO = window._JX_INFO || [];
    		_JX_INFO.push(["orderItemShare",[proId]]);
    		_JX_INFO.push(["clientId",10000]);
    		_JX_INFO.push(["go"]);
        }
       
        $(".qzone").click(function() {
        	pushDataToJZ($(this));
            var title = $(this).parents(".comWarea").find("textarea").val();
            var pic = $(this).parents('.submit').siblings('.sd').find('img').eq(0).attr('src');
            var url = $(this).parents(".comWarea").find(".proinfo .name").attr('href');
            window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?source=1000002&site=" + encodeURIComponent("http://www.jiuxian.com")
            + "&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&pic=" + encodeURIComponent(pic) + "&url=" + encodeURIComponent(url),
            "分享至腾讯微博",
            "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
        
        });


        $(".weibo").click(function() {
        	pushDataToJZ($(this));
            var title = $(this).parents(".comWarea").find("textarea").val();
            var pic = $(this).parents('.submit').siblings('.sd').find('img').eq(0).attr('src');
            var url = $(this).parents(".comWarea").find(".proinfo .name").attr('href');
            window.open("http://service.weibo.com/share/share.php?source=1000002&site=" + encodeURIComponent("http://www.jiuxian.com")
            + "&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&pic=" + encodeURIComponent(pic) + "&url=" + encodeURIComponent(url),
            "分享至新浪微博",
            "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
        
        });
        
        $(".renren").click(function() {
        	pushDataToJZ($(this));
            var title = $(this).parents(".comWarea").find("textarea").val();
            var pic = $(this).parents('.submit').siblings('.sd').find('img').eq(0).attr('src');
            var url = $(this).parents(".comWarea").find(".proinfo .name").attr('href');
            window.open("http://widget.renren.com/dialog/share?source=1000002&site=" + encodeURIComponent("http://www.jiuxian.com")
            + "&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&pic=" + encodeURIComponent(pic) + "&url=" + encodeURIComponent(url),
            "分享至人人网",
            "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
        
        });
        
        $(".tenxun").click(function() {
        	pushDataToJZ($(this));
            var title = $(this).parents(".comWarea").find("textarea").val();
            var pic = $(this).parents('.submit').siblings('.sd').find('img').eq(0).attr('src');
            var url = $(this).parents(".comWarea").find(".proinfo .name").attr('href');
            window.open("http://v.t.qq.com/share/share.php?source=1000002&site=" + encodeURIComponent("http://www.jiuxian.com")
            + "&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&pic=" + encodeURIComponent(pic) + "&url=" + encodeURIComponent(url),
            "分享至qq空间",
            "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
        
        });
        
        $(".kaixin").click(function() {
        	pushDataToJZ($(this));
            var title = $(this).parents(".comWarea").find("textarea").val();
            var pic = $(this).parents('.submit').siblings('.sd').find('img').eq(0).attr('src');
            var url = $(this).parents(".comWarea").find(".proinfo .name").attr('href');
            window.open("http://www.kaixin001.com/repaste/share.php?source=1000002&site=" + encodeURIComponent("http://www.jiuxian.com")
            + "&title=" + encodeURIComponent(title.replace(/&nbsp;/g, " ").replace(/<br \/>/g, " ")) + "&pic=" + encodeURIComponent(pic) + "&url=" + encodeURIComponent(url),
            "分享至开心网",
            "height=500,width=600,top=" + top + ",left=" + left + ",toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no");
        });
        


})